<template>
	<view class="login">
		<view class="login-head">
			<view class="head-box">
				<view class="logo">
					<view class="" style="position: absolute;left: 20rpx;top: 22rpx;z-index: 999;" @click="goback()">
						<svg t="1730859753212" class="icon" viewBox="0 0 1024 1024" version="1.1"
							xmlns="http://www.w3.org/2000/svg" p-id="4250" width="18" height="18">
							<path
								d="M474.496 512l338.752-338.752-90.496-90.496L293.504 512l429.248 429.248 90.496-90.496z"
								fill="#A6B2C0" p-id="4251"></path>
						</svg>
					</view>
					<!-- <image @click="goback()" class="close" src="../../static/img/close.png" mode=""></image> -->
					<view class="title">安全中心</view>
				</view>
				<view class="">
					
				</view>

			</view>
		</view>
		<view class="main">
			<view class="con">
			
				<view
					style="display: flex;align-items: center;margin-bottom: 20rpx;margin-top: 80rpx;">
					<!-- <image src="../../static/img/message.png" mode="" style="width: 70rpx;height:70rpx;border-radius: 50%;">
					</image> -->
					<view class="" style="flex: 1;">
						<view style="margin-left: 20rpx;font-size: 32rpx;font-weight: bold;" class="color-b">太平洋娱乐安全中心</view>
						<view style="margin-left: 20rpx;font-size: 24rpx;margin-top: 10rpx;"  class="colorc">为您的账户安全保驾护航</view>
					</view>
				<!-- 	<view class="">
						<svg t="1730859886122" class="icon" viewBox="0 0 1024 1024" version="1.1"
							xmlns="http://www.w3.org/2000/svg" p-id="4438" width="12" height="12">
							<path d="M324.3 960.1l-72.8-72.8L626.9 512 251.5 136.7l72.8-72.8L772.5 512z" fill="#A6B2C0"
								p-id="4439"></path>
						</svg>
					</view> -->
				</view>
					
				

			</view>
			<view class="" style="margin-top:150rpx;padding: 30rpx;">
				<view class="">
					<view @click="dlmm(1)" class="" style="display: flex;justify-content: space-between;color: #fff;font-size: 26rpx;border-bottom: 1rpx solid #33373f;background-color: #1C1E22;padding:30rpx 20rpx;">
						修改登录密码
						<svg t="1730859886122" class="icon" viewBox="0 0 1024 1024" version="1.1"
							xmlns="http://www.w3.org/2000/svg" p-id="4438" width="12" height="12">
							<path d="M324.3 960.1l-72.8-72.8L626.9 512 251.5 136.7l72.8-72.8L772.5 512z" fill="#A6B2C0"
								p-id="4439"></path>
						</svg>
					</view>
					<view @click="dlmm(2)" class="" style="display: flex;justify-content: space-between;color: #fff;font-size: 26rpx;border-bottom: 1rpx solid #33373f;background-color: #1C1E22;padding:30rpx 20rpx;">
						修改资金密码
						<svg t="1730859886122" class="icon" viewBox="0 0 1024 1024" version="1.1"
							xmlns="http://www.w3.org/2000/svg" p-id="4438" width="12" height="12">
							<path d="M324.3 960.1l-72.8-72.8L626.9 512 251.5 136.7l72.8-72.8L772.5 512z" fill="#A6B2C0"
								p-id="4439"></path>
						</svg>
					</view>
					<view  @click="dlmm(3)" class="" style="display: flex;justify-content: space-between;color: #fff;font-size: 26rpx;border-bottom: 1rpx solid #33373f;background-color: #1C1E22;padding:30rpx 20rpx;">
						提币地址管理
						<svg t="1730859886122" class="icon" viewBox="0 0 1024 1024" version="1.1"
							xmlns="http://www.w3.org/2000/svg" p-id="4438" width="12" height="12">
							<path d="M324.3 960.1l-72.8-72.8L626.9 512 251.5 136.7l72.8-72.8L772.5 512z" fill="#A6B2C0"
								p-id="4439"></path>
						</svg>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		login
	} from '../../api/api.js'
	export default {
		data() {
			return {
				name: '',
				psd: '',
				showmima: true,
				psdtype: 'password',
				forgotpsd: false
			}
		},
		methods: {
			changemimashowhide() {
				if (this.showmima) {
					this.showmima = false
					this.psdtype = 'text'
				} else {
					this.showmima = true
					this.psdtype = 'password'
				}
			},
			goregister() {
				uni.navigateTo({
					url: '/pages/login/register'
				})
			},
			checkboxChange(e) {
				this.forgotpsd = !this.forgotpsd
			},
		goback(){
			uni.navigateBack({
				delta:1
			})
			// uni.reLaunch({
			// 	url:'/pages/index/index'
			// })
		},
			dlmm(p){
				if(p==1){
					uni.navigateTo({
						url: '/pages/modLoginPwd/modLoginPwd'
					})
				}else if(p==2){
					uni.navigateTo({
						url: '/pages/modFundPwd/modFundPwd'
					})
				}else if(p==3){
					uni.navigateTo({
						url: '/pages/addCryptoAddr/index'
					})
				}
			},
			logins() {
				let that = this;
				if (this.name == '') {
					uni.showToast({
						title: '请输入用户名',
						icon: 'error',
						duration: 2000
					});
					return false
				}
				if (this.psd == '') {
					uni.showToast({
						title: '请输入密码',
						icon: 'error',
						duration: 2000
					});
					return false
				}
				let datas = {
					name: this.name,
					password: this.psd
				}
				login(datas).then(res => {
					if (res.data.status.errorCode == 0) {
						uni.showToast({
							title: res.data.status.msg,
							icon: 'success',
							duration: 2000
						});
						console.log(that.forgotpsd)
						if (that.forgotpsd) {
							uni.setStorage({
								key: 'username',
								data: datas
							})
						}
						uni.setStorage({
							key: 'token',
							data: res.data.data
						})
						uni.reLaunch({
							url: '/pages/index/index'
						})
					} else {
						uni.showToast({
							title: res.data.status.msg,
							icon: 'error',
							duration: 2000
						});
					}
				}).catch(err => {
					console.log(err)
				})
			}
		}
	}
</script>

<style scoped>
	* {
		box-sizing: border-box;
	}
	.mt-20{
		margin-top: 20rpx;
	}
	.arrow-left {
		width: 0;
		height: 0;
		border-top: 20px solid transparent;
		/* 控制箭头尖的高度 */
		border-bottom: 20px solid transparent;
		/* 控制箭头尖的高度 */
		border-right: 30px solid black;
		/* 箭头颜色 */
	}

	.login {
		width: 100%;
		min-height: 100vh;
		/* background-color: #202327; */
		display: flex;
		flex-direction: column;
		/* height: 100%; */
		background: url('../static/img/anquan.png') #24262b no-repeat center -.66667rem;
		background-size: contain;
		width: 100%;
		/* height: 514rpx; */
	}

	.login-head {
		
		/* background: url('../../static/img/loginbg.jpg') no-repeat center 50rpx; */
		/* background-size: cover; */
	}

	.head-box {
		width: 100%;
		/* padding: 32rpx 40rpx 0 40rpx; */
		display: flex;
		justify-content: center;
		align-items: center;
		/* flex-direction: column; */

	}

	.logo {
		width: 100%;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.logo .logoimg {
		width: 148rpx;
		height: 80rpx;
	}

	.logo .close {
		width: 38rpx;
		height: 38rpx;
	}

	.notes {
		text-align: center;
		align-self: flex-end;
		margin-top: 108rpx;
		color: #fff;
	}

	h4 {
		font-weight: 700;
		font-size: 34rpx;
		line-height: 40rpx;
	}

	b {
		color: #27d477;
	}

	.color-b {
		color: #fff;
	}
	.colorc{
		color: #9ba6b3;
	}

	.font-28 {
		font-size: 28rpx;
		margin-bottom: 20rpx;
	}

	.sub {
		line-height: 30rpx;
		color: #9ba6b3;
		font-size: 24rpx;
	}

	.title {
		text-align: center;
		/* font-weight: 600; */
		font-size: 30rpx;
		/* margin-top: 52rpx; */
		padding: 20rpx 0;
		color: #fff;
	}

	.main {
		margin-top: -60rpx;
		position: relative;
	}

	.con {
		width: 100%;
		/* padding: 48rpx 40rpx 60rpx 40rpx; */
		padding: 20rpx;
		margin-top: 86rpx;
	}

	.common {
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		flex-direction: column;
		flex-wrap: nowrap;
		position: relative;
		margin-bottom: 20rpx;
	}

	.input {
		height: 100rpx;
		width: 100%;
		border: 0;
		padding: 24rpx 40rpx;
		border-radius: 4rpx;
		background: #1a1c20;
		overflow: visible;
		font-size: 28rpx;
		color: #fff;
	}

	.place {
		font-size: 24rpx;
		color: #7c7c7c;
	}

	.mimashowhide {
		width: 34rpx;
		height: 34rpx;
		padding: 0 16rpx;
		position: absolute;
		top: 50%;
		right: 16rpx;
		margin-top: -17rpx;
		box-sizing: content-box;
	}

	.remember-forget {
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-size: 24rpx;
		color: #fff;
	}

	/deep/ .uni-label-pointer {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	/deep/ .uni-checkbox-input {
		width: 26rpx;
		height: 26rpx;
		margin-right: 0;
		box-sizing: border-box;
		background-color: transparent;
		border-color: #33d47e;
		margin-top: -6rpx;
	}

	/deep/ .uni-checkbox-input svg {
		transform: translate(-50%, -48%) scale(0.5);
	}

	.remember-forget text {
		margin-left: 10rpx;
	}

	.login-btn {
		width: 100%;
		height: 64rpx;
		margin-top: 40rpx;
		margin-bottom: 20rpx;
		font-size: 26rpx;
		text-align: center;
		line-height: 64rpx;
		border-radius: 12rpx;
		background: #fee619;
		font-weight: 700;
		color: #1c1e22;
		box-shadow: 0 8rpx 0 0 #d9a715, inset 0 0 24rpx 6rpx rgba(243, 48, 48, .34), 0 4rpx 12rpx 6rpx rgba(255, 123, 1, .34);
	}

	.to-regist {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.left {
		color: #97a6b4;
		font-size: 28rpx;
		font-weight: 600;
	}

	.left text {
		color: #33d47e;
		font-size: 32rpx;
	}

	.to-regist image {
		width: 34rpx;
		height: 32rpx;
	}
</style>